/* $Id: XPRINTF.h 2 2010-10-06 01:53:47Z dheater@heatertech.com $ */

#ifndef XPRINTF_H
#define XPRINTF_H

#include <stdio.h>

#undef EPRINTF
#ifdef NO_PRINT_ERROR
#define EPRINTF(x...)
#define PERROR(x)
#else
#define EPRINTF(x...) fprintf(stderr, "ERROR:%s:%d:",__FILE__, __LINE__); \
    fprintf(stderr,x)
#define PERROR(x) perror(x)
#endif

/* Clear the NO_PRINT_ERROR flag for the next inclusion. */
#undef NO_PRINT_ERROR

#undef WPRINTF
#ifdef NO_PRINT_WARNING
#define WPRINTF(x...)
#else
#define WPRINTF(x...) fprintf(stderr, "WARNING:%s:%d:",__FILE__, __LINE__); \
    fprintf(stderr,x)
#endif

/* Clear the NO_PRINT_WARN flag for the next inclusion. */
#undef NO_PRINT_WARNING

#undef IPRINTF
#ifdef NO_PRINT_INFO
#define IPRINTF(x...)
#else
#define IPRINTF(x...)  printf(x)
#endif

/* Clear the NO_PRINT_INFO flag for the next inclusion. */
#undef NO_PRINT_INFO

#undef DPRINTF
#ifdef PRINT_DEBUG
#define DPRINTF(x...) fprintf(stderr, "DEBUG:%s:%d:",__FILE__, __LINE__); \
    fprintf(stderr, x)
#else
#define DPRINTF(x...)
#endif

/* Clear the PRINT_DEBUG flag for the next inclusion. */
#undef PRINT_DEBUG

/* Clear the PRINT_VERBOSE flag for the next inclusion. */
#undef PRINT_VERBOSE

#endif /* XPRINTF_H */
